package 方法;

import java.util.Arrays;

/**
 * @Author Mucd
 * @ClassName Test
 * @Date 2020/12/10/010
 * @Specification Alibaba
 */
public class Test {
    public static void main(String[] args) {
        daffodil(400, 800);
        System.out.println("____________");
        hua();
    }

    /**
     * @param num1
     * @param num2 有参构造方法
     */
    public static void daffodil(int num1, int num2) {
        int minDaffodil = 100;
        int maxDaffodil = 1000;
        if (num1 >= minDaffodil || num2 <= maxDaffodil) {
            for (; num1 < num2; num1++) {
                int ge = num1 % 10;
                int shi = num1 / 10 % 10;
                int bai = num1 / 100 % 10;
                if ((ge * ge * ge) + (shi * shi * shi) + (bai * bai * bai) == num1) {
                    System.out.println("水仙花数:" + num1);
                }
            }
        } else {
            System.out.println("只能输入100 - 999的 数字");
        }

    }

    /**
     * 无参方法
     */
    public static void hua() {
        int minDaffodil = 100;
        int maxDaffodil = 1000;
        for (int i = minDaffodil; i < maxDaffodil; i++) {
            int ge = i % 10;
            int shi = i / 10 % 10;
            int bai = i / 100 % 10;
            if ((ge * ge * ge + shi * shi * shi + bai * bai * bai) == i) {
                System.out.println("水仙花数:" + i);
            }
        }
    }
}